Skip to content

Feat/get info context#10

Merged
sznicolas merged 17 commits intomainfrom
feat/get-info-context
Mar 29, 2026
Merged

Feat/get info context#10
sznicolas merged 17 commits intomainfrom
feat/get-info-context

Conversation

@sznicolas
Copy link
Copy Markdown
Owner

No description provided.

nsz and others added 17 commits March 8, 2026 23:20
Add two new exception classes:
- TaskConfigurationError(TaskWarriorError): environment/config errors
  (binary not found, taskrc file missing or unreadable)
- TaskOperationError(TaskWarriorError): write operation failures on
  existing tasks (delete, purge, done, start, stop, annotate)

Export all 6 exceptions from __init__.py (they were not public before)

Semantic fixes:
- TaskValidationError → TaskConfigurationError for 'binary not found'
- TaskValidationError → TaskWarriorError for JSON parse errors on CLI responses
- TaskNotFound → TaskOperationError for delete/purge/done/start/stop/annotate
- TaskNotFound → TaskWarriorError for JSON errors in get_recurring_instances
- TaskWarriorError → TaskNotFound when get_task returns nonzero returncode
- TaskValidationError → TaskWarriorError in modify_task (generic CLI failure)
- TaskWarriorError → TaskValidationError in ContextService._validate_name
- TaskWarriorError → TaskConfigurationError in UdaRegistry for missing taskrc
- RuntimeError → TaskWarriorError in add_task fallback path

Missing coverage added:
- OSError/SubprocessError wrapped in TaskWarriorError in run_task_command
- try/except json.JSONDecodeError added in get_recurring_task (only method missing it)
- FileNotFoundError/PermissionError/OSError handled in ConfigStore._extract_taskrc_config
- Double ValueError fixed in parse_taskwarrior_date (fallback could raise uncaught)

Update Raises: docstrings in main.py to reflect new exception types.
Update tests to match new exception behaviors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- pyproject.toml: 1.1.2rc1 → 1.2.0
- CHANGELOG: add [1.2.0] entry covering exception refactor and sync infra
- README: update version line (v1.1.1 → v1.2.0), test count (132 → 164),
  pip install command, remove outdated sync notice, add Exceptions section
  with table and import examples
- PYPI_README: update test count and add exception hierarchy to features list
- RELEASE_NOTES: replace 1.0.0 notes with 1.2.0 release notes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the taskchampion-py-based SyncLocal backend with a direct call to
the TaskWarrior CLI's built-in 'task sync' command.

Removed:
- taskchampion-py dependency from pyproject.toml
- src/taskwarrior/sync_backends/ (sync_local.py, sync_protocol.py, factory.py)
- champion.py (exploratory root-level script)
- tests: test_sync_local, test_sync_factory, test_sync_integration,
         test_sync_disabled_facade (all taskchampion-specific)

Changed:
- TaskWarriorAdapter: _sync field replaced by _sync_configured bool;
  synchronize() runs run_task_command(['sync']), raises TaskSyncError
  if not configured or if task sync exits non-zero
- TaskWarrior (façade): synchronize() now calls self.adapter.synchronize()
  and is no longer a no-op; docstring updated
- CHANGELOG: 1.2.0 entry updated (sync section rewritten)
- README: sync table updated, temporary notice removed

Added:
- tests/unit/test_adapter_sync.py — 9 tests covering is_sync_configured()
  and synchronize() (not-configured, success, stderr/stdout errors)
- test_main_sync.py rewritten: delegates to adapter, propagates TaskSyncError

164 tests passing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Removed verbose taskchampion removal narrative from CHANGELOG
- Removed outdated 1.1.2rc1 RC entry (superseded by 1.2.0)
- Consolidated exception and sync changes for clarity
- Updated RELEASE_NOTES to emphasize sync now works (not 'temporarily disabled')
- All 164 tests passing

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Delete TaskWarrior.task_cmd and TaskWarrior.taskrc_file storage (lines 92-93)
- These values already exist in TaskWarriorAdapter and ConfigStore (single source of truth)
- Update get_info() to delegate to adapter.task_cmd and config_store.taskrc_path
- Add public taskrc_path property to ConfigStore for clean access
- All 164 tests pass

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ow returns current_context and current_context_details (name, read_filter, write_filter, active)\n- Safe fallback when context lookup fails\n- Added unit tests: tests/unit/test_get_info_context.py\n\nAll tests passing (166 total)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>,
Include current_context and current_context_details in get_info output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add unit tests verifying that TaskWarrior.get_tasks applies the active context read_filter when present.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Annotate local variables in TaskWarrior.get_info as dict[str, Any] to avoid mypy inference errors.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add CHANGELOG entry explaining that get_tasks combines active context read_filter with user filter.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add release note describing that get_tasks now combines active context read_filter with user filter.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sznicolas sznicolas merged commit 1028cc7 into main Mar 29, 2026
3 checks passed
@sznicolas sznicolas deleted the feat/get-info-context branch March 31, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant